<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div>
    houduanren.com
  </div>
</body>
<script>
const div=document.querySelector("div")
let con=prompt("请输入要检测的内容，支持正则")
let res=new RegExp(con,"g")
  div.innerHTML=div.innerHTML.replace(res,(str)=>{
    return `<span style='color:red'>${str}</span>`
  })
</script>
</html>